package com.car.mapper;

import com.car.pojo.Admin;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * 管理员数据访问接口
 */
@Mapper
public interface AdminMapper {

    /**
     * 根据用户名和密码查询管理员信息
     */
    @Select("select id, username, name from admin where username = #{username} and password = #{password}")
    Admin selectByUsernameAndPassword(Admin admin);

    /**
     * 根据ID查询管理员信息
     */
    @Select("select id, username, name, phone, create_time, update_time from admin where id = #{id}")
    Admin selectById(Integer id);
}